using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation.Data;
using MHI.InspectionManager.Interfaces; 

namespace MHI.InspectionManager.Data
{
	/// <summary>
	/// DevJobinspectionstepT,table entity:dev_jobinspectionstep_t 
	/// </summary>
	internal class DevJobinspectionstepTWritingDAO : WritableDAO<DevJobinspectionstepT> 
	{
		protected static DbManager _dbManager = DbManager.FromConfig("DefaultConnection");

		public DevJobinspectionstepTWritingDAO()
		: base(_dbManager)
		{
		}

		public DevJobinspectionstepTWritingDAO(DbManager db)
		: base(db)
		{
			_dbManager = db;
		}

		/// <summary>
		/// 增加一行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool AddDevJobinspectionstepT(DevJobinspectionstepT item)
		{
			this.Add(item);
			return true;
		}

		/// <summary>
		/// 增加多行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool AddDevJobinspectionstepTs(DevJobinspectionstepT[] items)
		{
			this.Add(items);
			return true;
		}

		/// <summary>
		/// 更新一行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool UpdateDevJobinspectionstepT(DevJobinspectionstepT item)
		{
			bool bOK = this.Update(item);
			return bOK;
		}

		/// <summary>
		///  更新多行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool UpdateDevJobinspectionstepTs(DevJobinspectionstepT[] items)
		{
			bool bOK = this.Update(items);
			return bOK;
		}

		/// <summary>
		/// 删除一行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool DeleteDevJobinspectionstepT(DevJobinspectionstepT item)
		{
			bool bOK = this.Delete(item);
			return bOK;
		}

		/// <summary>
		///  删除多行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool DeleteDevJobinspectionstepTs(DevJobinspectionstepT[] items)
		{
			bool bOK = this.Delete(items);
			return bOK;
		}

		/// <summary>
		///  根据ids，删除多行DevJobinspectionstepT,table entity:dev_jobinspectionstep_t信息 
		/// </summary>
		/// <returns></returns>
		public bool DeleteDevJobinspectionstepTByIds(int[] ids)
		{
			for (int i = 0; i < ids.Length; i++)
			{
				DynamicalBatchExcutor<DevJobinspectionstepT> excutor = new DynamicalBatchExcutor<DevJobinspectionstepT>(this.DBManager);
				excutor.Query().Filter().Eq(r => r.Id, ids[i]);
				excutor.BatchDelete(this.Transaction, _TimeOut);
			}
			return true;
		}

	}
}
